cmake_minimum_required(VERSION 3.22)

project(Cbb)
add_library(Cbb INTERFACE)

# Enable CMake support for ASM and C languages
enable_language(C ASM)

add_subdirectory(IAP)
add_subdirectory(Init)
add_subdirectory(Delay)
add_subdirectory(Mem)
add_subdirectory(Bit)
add_subdirectory(Event)
add_subdirectory(Soft_Tim)
add_subdirectory(Verify)
add_subdirectory(Protocol)
add_subdirectory(Queue)

target_link_libraries(${CMAKE_PROJECT_NAME}
    IAP
    Init    
    Delay
    Mem
    Bit
    Event
    Soft_Tim
    Verify
    Protocol
    Queue
)

# Validate that STM32CubeMX code is compatible with C standard
if(CMAKE_C_STANDARD LESS 11)
    message(ERROR "Generated code requires C11 or higher")
endif()


